/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

&soc {

	led_flash0: qcom,camera-led-flash {
		cell-index = <0>;
		compatible = "qcom,camera-led-flash";
		qcom,flash-type = <1>;
		qcom,flash-source = <&pm8226_flash0 &pm8226_flash1>;
		qcom,torch-source = <&pm8226_torch>;
	};

	spi@f9923000 {
		eeprom0: qcom,eeprom@0 {
			compatible = "qcom,eeprom";
			reg = <0>;
			cell-index = <0>;
			spi-max-frequency = <50000000>;
			qcom,eeprom-name = "fidelix";
			qcom,eeprom-id0 = <0xf8 0x14>;
			qcom,eeprom-id1 = <0xef 0x13>;
			qcom,eeprom-id2 = <0xef 0x14>;

			qcom,cal-num-blocks = <8>;
			qcom,cal-page0 = <0 0x0 0 0x0 0 0>;
			qcom,cal-poll0 = <0 0x0 0 0x0 0 0>;
			qcom,cal-mem0 = <0x80 0x0 3 0 1 0>;
			qcom,cal-page1 = <0 0x0 0 0x0 0 0>;
			qcom,cal-poll1 = <0 0x0 0 0x0 0 0>;
			qcom,cal-mem1 = <4 0xFFC 3 0 1 0>;
			qcom,cal-page2 = <0 0x0 0 0x0 0 0>;
			qcom,cal-poll2 = <0 0x0 0 0x0 0 0>;
			qcom,cal-mem2 = <0x900 0x1000 3 0 1 0>;
			qcom,cal-page3 = <0 0x0 0 0x0 0 0>;
			qcom,cal-poll3 = <0 0x0 0 0x0 0 0>;
			qcom,cal-mem3 = <4 0x1FFC 3 0 1 0>;
			qcom,cal-page4 = <0 0x0 0 0x0 0 0>;
			qcom,cal-poll4 = <0 0x0 0 0x0 0 0>;
			qcom,cal-mem4 = <0x40 0x2000 3 0 1 0>;
			qcom,cal-page5 = <0 0x0 0 0x0 0 0>;
			qcom,cal-poll5 = <0 0x0 0 0x0 0 0>;
			qcom,cal-mem5 = <4 0x2FFC 3 0 1 0>;
			qcom,cal-page6 = <0 0x0 0 0x0 0 0>;
			qcom,cal-poll6 = <0 0x0 0 0x0 0 0>;
			qcom,cal-mem6 = <0x700 0x3000 3 0 1 0>;
			qcom,cal-page7 = <0 0x0 0 0x0 0 0>;
			qcom,cal-poll7 = <0 0x0 0 0x0 0 0>;
			qcom,cal-mem7 = <4 0x3FFC 3 0 1 0>;

			qcom,cam-vreg-name = "cam_vio";
			qcom,cam-vreg-type = <0>;
			qcom,cam-vreg-op-mode = <1800000>;
			qcom,cam-power-seq-type = "sensor_gpio";
			qcom,cam-power-seq-val = "sensor_gpio_ext_camio_en";
			qcom,cam-power-seq-cfg-val = <1>;
			qcom,cam-power-seq-delay = <2>;
			gpios = <&msmgpio 114 0>;
			qcom,gpio-ext-camio-en = <0>;
			qcom,gpio-req-tbl-num = <0>;
			qcom,gpio-req-tbl-flags = <0>;
			qcom,gpio-req-tbl-label = "CAM_IO_EN";
			qcom,spiop-read = <0x03 3 0 0 0>;
			qcom,spiop-readseq = <0x03 3 0 0 0>;
			qcom,spiop-queryid = <0x90 3 0 0 0>;
			qcom,spiop-pprog = <0x02 3 0 3 3>;
			qcom,spiop-wenable = <0x06 0 0 0 0>;
			qcom,spiop-readst = <0x05 0 0 0 0>;
			qcom,spiop-erase = <0x20 3 0 10 30>;
			qcom,spi-busy-mask = <0x01>;
			qcom,spi-page-size = <256>;
			qcom,spi-erase-size = <4096>;
		};
	};

};

&cci {
	qcom,camera@0 {
		cell-index = <0>;
		compatible = "qcom,camera";
		reg = <0x0>;
		qcom,csiphy-sd-index = <0>;
		qcom,csid-sd-index = <0>;
		qcom,actuator-src = <&actuator1>;
		qcom,eeprom-src = <&eeprom0>;
		qcom,led-flash-src = <&led_flash0>;
		cam_vdig-supply = <&pm8226_l26>;
		cam_vaf-supply = <&pm8226_l28>;
		qcom,cam-vreg-name = "cam_vdig", "cam_vaf";
		qcom,cam-vreg-type = <0 0>;
		qcom,cam-vreg-op-mode = <1225000 2800000>;
		qcom,gpio-no-mux = <0>;
		gpios = <&msmgpio 26 0>,
			<&msmgpio 37 0>,
			<&msmgpio 112 0>,
			<&msmgpio 114 0>;
		qcom,gpio-reset = <1>;
		qcom,gpio-ext-vana-power = <2>;
		qcom,gpio-ext-camio-en = <3>;
		qcom,gpio-req-tbl-num = <0 1 2 3>;
		qcom,gpio-req-tbl-flags = <1 0 0 0>;
		qcom,gpio-req-tbl-label = "CAMIF_MCLK", "CAM_RESET", "CAM_VANA_GPIO" , "CAM_IO_EN";
		qcom,cci-master = <0>;
		status = "ok";
	};
 
	qcom,camera@2 {
		cell-index = <2>;
		compatible = "qcom,camera";
		reg = <0x2>;
		qcom,csiphy-sd-index = <1>;
		qcom,csid-sd-index = <1>;
		cam_vdig-supply = <&pm8226_l5>;
		qcom,cam-vreg-name = "cam_vdig";
		qcom,cam-vreg-type = <0>;
		qcom,cam-vreg-op-mode = <1200000>;
		qcom,gpio-no-mux = <0>;
		gpios = <&msmgpio 27 0>,
			<&msmgpio 28 0>,
			<&msmgpio 38 0>,
			<&msmgpio 112 0>,
			<&msmgpio 114 0>;
		qcom,gpio-req-tbl-num = <0 1 2 3 4>;
		qcom,gpio-req-tbl-flags = <1 0 0 0 0>;
		qcom,gpio-req-tbl-label = "CAMIF_MCLK", "CAM_VT_RESET", "CAM_VT_STBY", "CAM_VANA_GPIO", "CAM_IO_EN";
		qcom,gpio-vt-reset = <1>;
		qcom,gpio-vt-standby = <2>;
		qcom,gpio-ext-vana-power = <3>;
		qcom,gpio-ext-camio-en = <4>;
		qcom,cci-master = <0>;
		status = "ok";
	};
};
